package manager.dao;

import manager.bean.Department;
import manager.util.JDBC;

import java.util.List;

public class DepartmentDao {
    public List<Department> getDepartment(String sql, Object... params) {
        List<Department> list = JDBC.query(sql,Department.class,params);
        return list;
    }
    public int getid(String sql,Object... params){
        int res = JDBC.queryNum(sql,params);
        return res;
    }
    public int deleteDepartment (String sql,Object... params){
        int count = JDBC.delete(sql,params);
        return count;
    }
    public int addDepartment(String sql,Object... params){
        int count = JDBC.insert(sql,params);
        return count;
    }
    public int editDepartment(String sql,Object... params){
        int count = JDBC.update(sql,params);
        return count;
    }
    public int countDepartment(String sql,Object... params){
        int count = JDBC.queryNum(sql,params);
        return count;
    }
}
